package api_.collectionTest;

import com.sun.org.glassfish.gmbal.IncludeSubclass;
import sun.security.krb5.internal.tools.Klist;

import java.util.LinkedList;

public class LinkedListDemo
{
    public static void main(String[] args)
    {
        LinkedList<Integer> linkedList = new LinkedList<>();
        linkedList.add(1);
        linkedList.add(2);
        linkedList.add(3);
        linkedList.addFirst(0);
        linkedList.addLast(4);
        // 操作上，LinkedList 和 arrayList的区别就是， LinkedList多了一些关于首尾的操作
        Integer first = linkedList.removeFirst();
        Integer last = linkedList.removeLast();
        System.out.println("first = " + first);
        System.out.println("last = " + last);

    }
}